/**
 * 
 */
package com.shop.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shop.entities.User;
import com.shop.repositories.UserRepository;

/**
 * @author Siva
 *
 */
@Service
@Transactional
public class UserService 
{
	@Autowired private UserRepository userRepository;
	
	public List<User> findAllUsers() {
		return userRepository.findAllUsers();
	}
	
	
	public User findUsersById(int id) {
		return userRepository.findUserById(id);
	}
	
	
	
	public void addUser(User u) {
		 userRepository.addUser(u);
	}
	
	public void updateUser(User u) {
		 userRepository.updateUser(u);
	}
	
	public void deleteUser(User u) {
		 userRepository.deleteUser(u);
	}
	
}
